home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / library / cgl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-11  |  10.3 KB  |  226 lines

  1. #ifndef __CGL__
  2. #define __CGL__
  3.      /*********************************************************************
  4.      
  5.      cgl.h
  6.      
  7.      Copyright (c) Creative Technology Ltd. 1994-1995. All Rights Reserved.
  8.      
  9.      THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
  10.      KIND,  EITHER EXPRESSED OR IMPLIED,  INCLUDING BUT NOT LIMITED TO THE 
  11.      IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR 
  12.      PURPOSE.
  13.      
  14.      *********************************************************************/
  15.  
  16. /*
  17.  * @@ SOURCE DOCUMENTATION
  18.  *
  19.  * TITLE    : cgl.h
  20.  * 
  21.  * VERSION  : 0.01
  22.  *
  23.  * DATE     : 1 December 1994
  24.  *
  25.  * AUTHOR   : Philip Teo
  26.  *            Toh Chin Kok
  27.  *            Burak Alp
  28.  *
  29.  * BRIEF    : This file includes the function prototypes of all
  30.  *            the graphic library supported
  31.  *
  32.  * @@ LOG CHANGE
  33.  * DATE         VERSION   REV          DESCRIPTION
  34.  * 13 Feb 95     1.0      Philip Teo   First library version
  35.  * 11 Mar 95     1.1      Philip Teo   Second library version
  36.  * 11 Apr 95     1.2      Philip Teo   Third library fixed point version
  37.  */
  38.  
  39. #if (defined(__WATCOMC__) || defined(__SC__))
  40. #define __32BIT_COMPILER__
  41. #elif defined(WIN32)
  42. #define __W32BIT_COMPILER__
  43. #endif
  44.  
  45. #include "cgltype.h"
  46. #include "cglerr.h"
  47. #include "cgldef.h"
  48.  
  49. #ifdef WIN32
  50. #include "cglwin.h"
  51. #endif
  52.  
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif
  56.  
  57. /////////////////////////////
  58. // Prototypes declaration  //
  59. /////////////////////////////
  60.  
  61.  
  62.  
  63. ////////////////////////////////////////////////////////////////////
  64. // Primitive Operation Function                                   //
  65. ////////////////////////////////////////////////////////////////////
  66. //                                                                //
  67. // cglSendStream    - Function to perform block operation for     //
  68. //                    render, copy, upload and download           //
  69. // cglGetPixel      - Function to get pixel color                 //
  70. // cglPutPixel      - Function to put pixel color                 //
  71. //                                                                //
  72. //                                                                //
  73. ////////////////////////////////////////////////////////////////////
  74.  
  75. extern CGL_INT16 CGL_API(cglSendStream)(CGL_PTR, CGL_UINT16);
  76. extern CGL_INT16 CGL_API(cglGetPixel)(CGL_TYPE, CGL_TYPE, CGL_COLOR_PST);
  77. extern CGL_INT16 CGL_API(cglPutPixel)(CGL_TYPE, CGL_TYPE ,CGL_COLOR_PST);
  78.  
  79. ////////////////////////////////////////////////////////////////////
  80. // Screen/Window Functions                                        //
  81. ////////////////////////////////////////////////////////////////////
  82. //                                                                //
  83. // cglInitScreen     - Initialise screen device &  configuration  //
  84. // cglQueryScreen    - Query for valid screen configuration       //
  85. // cglClearScreen    - Clear thes screen                          //
  86. // cglCloseScreen    - Close the screen device                    //
  87. // cglSetWindowClip  - Set the clipping window within the screen  //
  88. // cglInitPan        - Initialise pan mode                        //
  89. // cglSetPanPos      - Set panning position                       //
  90. //                                                                //
  91. ////////////////////////////////////////////////////////////////////
  92.  
  93. extern CGL_INT16 CGL_API(cglInitScreen)(CGL_SCREEN_PST);
  94. extern CGL_INT16 CGL_API(cglQueryScreen)(CGL_SCREEN_PST);
  95. extern CGL_INT16 CGL_API(cglClearScreen)(void);
  96. extern CGL_INT16 CGL_API(cglCloseScreen)(void);
  97. extern CGL_INT16 CGL_API(cglSetWindowClip)(CGL_RECT_PST);
  98. extern CGL_INT16 CGL_API(cglInitPan)(CGL_UINT16 *);
  99. extern CGL_INT16 CGL_API(cglPanPos)(CGL_UINT16, CGL_UINT16);
  100.  
  101. ////////////////////////////////////////////////////////////////////
  102. // Primitive Property Functions                                   //
  103. ////////////////////////////////////////////////////////////////////
  104. //                                                                //
  105. //  cglSetLineStyle       - Set the line style pattern for line   //
  106. //                          primitive                             //
  107. //  cglSetFillPattern     - Set the fill area pattern for area    //
  108. //                          primitive                             //
  109. //  cglSetStipplePattern  - Set the stipple pattern for area      //
  110. //                          primitive                             //
  111. //  cglSetDepthMode       - Set the depth comparision mode for    //
  112. //                          depth test.                           //
  113. //  cglSetStencilMode     - Set the stencil comparision and       //
  114. //                          update methods for stencil test.      //
  115. //  cglSetLogicalOpsMode  - Set the comparision mode for logical  //
  116. //                          operation for frame buffer            //
  117. //  cglSetDitherMode      - Enable or disable dither function     //
  118. //                                                                //
  119. ////////////////////////////////////////////////////////////////////
  120.  
  121. extern CGL_INT16 CGL_API(cglSetLineStyle)(CGL_PTR, CGL_UINT32);
  122. extern CGL_INT16 CGL_API(cglSetFillPattern)(CGL_PTR, CGL_UINT32);
  123. extern CGL_INT16 CGL_API(cglSetStipplePattern)(CGL_UINT8 *);
  124. extern CGL_INT16 CGL_API(cglSetDepthMode)(CGL_UINT16);
  125. extern CGL_INT16 CGL_API(cglSetStencilMode)(CGL_UINT16,CGL_UINT16,
  126.                                            CGL_UINT16,CGL_UINT16);
  127. extern CGL_INT16 CGL_API(cglSetLogicalOpsMode)(CGL_UINT16);
  128. extern CGL_INT16 CGL_API(cglSetDepthCueColor)(CGL_COLOR_PST);
  129. extern CGL_INT16 CGL_API(cglSetDitherMode)(CGL_UINT16);
  130.  
  131.  
  132. ///////////////////////////////////////////////////////////////////
  133. // Texture Mangement Function                                    //
  134. ///////////////////////////////////////////////////////////////////
  135. //                                                               //
  136. //  cglLoadTextureMap     - Load the texture into free memory    //
  137. //                          space.                               //
  138. //                                                               //
  139. ///////////////////////////////////////////////////////////////////
  140.  
  141. extern CGL_INT16 CGL_API(cglLoadTextureMap)(CGL_TEXTURELD_PST);
  142.  
  143.  
  144. //////////////////////////////////////////////////////////////////          
  145. // Buffer Management Function                                   //
  146. //////////////////////////////////////////////////////////////////
  147. //                                                              //
  148. //  cglSelectRenderBuffer - select render to front/back buffer  //
  149. //                                                              //
  150. //  cglCopyDisplayBuffer  - copy front/back buffer              //
  151. //                                                              //
  152. //  cglSetConstant        - Set the constant value for clear    //
  153. //                          buffers.                            //
  154. //  cglClearBuffer        - Clear multiple buffers to constant  //
  155. //                          value respectively                  //
  156. //                                                              //
  157. //  cglSwapBuffer         - Swap buffers for double buffering   //
  158. //                                                              //
  159. //////////////////////////////////////////////////////////////////
  160.  
  161.  
  162. extern CGL_INT16 CGL_API(cglSelectRenderBuffer)(CGL_UINT16);
  163. extern CGL_INT16 CGL_API(cglCopyDisplayBuffer)(CGL_UINT16);
  164. extern CGL_INT16 CGL_API(cglLockBuffer)(CGL_UINT16,CGL_FPTR *);
  165. extern CGL_INT16 CGL_API(cglClearBuffer)(CGL_UINT32,CGL_RECT_PST);
  166. extern CGL_INT16 CGL_API(cglSetConstant)(CGL_COLOR_PST,CGL_UINT32,CGL_UINT32);
  167. extern CGL_INT16 CGL_API(cglSwapBuffer)(void);
  168.  
  169.  
  170. //////////////////////////////////////////////////////////////////
  171. // Color Management Function                                    //                             
  172. //////////////////////////////////////////////////////////////////
  173. //                                                              //
  174. // cglUpLoad         - Retrieve data to host buffer             //
  175. // cglDownLoad       - Send data from host buffer               //
  176. // cglSetPalette     - Set the color palette table              //
  177. // cglGetPalette     - Retrieve color data from palette table   //
  178. //                                                              //
  179. ////////////////////////////////////////////////////////////////// 
  180.  
  181. extern CGL_INT16 CGL_API(cglUpLoad)(CGL_UPDN_PST);
  182. extern CGL_INT16 CGL_API(cglDownLoad)(CGL_UPDN_PST);
  183. extern CGL_INT16 CGL_API(cglSetPalette)(CGL_PTR, CGL_UINT16, CGL_UINT16);
  184. extern CGL_INT16 CGL_API(cglGetPalette)(CGL_PTR, CGL_UINT16, CGL_UINT16);
  185.  
  186.  
  187. //////////////////////////////////////////////////////////////////
  188. // Querey Control Function                                      //
  189. //////////////////////////////////////////////////////////////////
  190. //                                                              //
  191. //  cglSetPickRegion   - Set the condition and region of        //
  192. //                       interest to pick                       //
  193. //  cglSetExtentRegion - Set the extent condition               // 
  194. //  cglGetPickResult   - Get the result of picking              //
  195. //  cglGetExtentRegion - Get the extented region                //
  196. //  cglGetConfig       - Get the version of software and        //
  197. //                       hardware supported information         //
  198. //  cglSetCursor       - Set cursor on/off,color and pattern    //
  199. //  cglSetCursorPos    - Set cursor position                    //
  200. //////////////////////////////////////////////////////////////////
  201.  
  202. extern CGL_INT16 CGL_API(cglSetPickRegion)(CGL_PICK_PST);
  203. extern CGL_INT16 CGL_API(cglGetPickResult)(CGL_UINT8P);
  204. extern CGL_INT16 CGL_API(cglSetExtent)(CGL_EXTENT_PST);
  205. extern CGL_INT16 CGL_API(cglGetExtentResult)(CGL_RECT_PST);
  206. extern CGL_INT16 CGL_API(cglGetConfig)(CGL_GPCONFIG_PST);
  207. extern CGL_INT16 CGL_API(cglSetCursor)(CGL_UINT8, CGL_COLOR_PST, CGL_UINT8 *);
  208. extern CGL_INT16 CGL_API(cglSetCursorPos)(CGL_UINT16,CGL_UINT16);
  209. extern CGL_INT16 CGL_API(cglSetupInterrupt)(CGL_UINT32, CGL_ISRPROC, CGL_PTR);
  210. extern CGL_INT16 CGL_API(cglReleaseInterrupt)(CGL_UINT32);
  211.  
  212. //-- For Dynmaic Library
  213.  
  214. #ifdef CGLCDL
  215. extern CGL_INT16 cglStub();
  216. int    cglLoad(char *path);
  217. int    cglUnload(void);
  218. #endif
  219.  
  220. #ifdef __cplusplus
  221. }
  222. #endif
  223.  
  224. #endif  // __CGL_
  225.  
  226.